To consider:
netbsd "carota-sativa" {
service ssh {
enable
}
}
How would this result in a system with SSH enabled? The netbsd handler would see service, and would invoke the netbsd.service handler, which in turn would invoke netbsd.service.ssh, which in turn would turn that into something like:
package ssh from=sets.core
service dinitd.sshd {
type process
smooth-recovery
command /usr/sbin/sshd -D
depends-on login-ready
}
This would get processed by netbsd.service again, and would invoke netbsd.service.dinitd.sshd, which would yield a derivation that puts the service file to the right place.
The key here is that handles should be able to return a vector of results, either KDL or derivations, or a mix of both (they're both the same type, different variants of an enum).